home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nebula 1
/
Nebula One.iso
/
Mail
/
pine3.92
/
pine
/
osdep
/
rename.hom
< prev
next >
Wrap
Text File
|
1993-07-15
|
488b
|
23 lines
/*----------------------------------------------------------------------
Rename a file
Args: tmpfname -- Old name of file
fname -- New name of file
Result: File is renamed. Returns 0 on success, else -1 on error
and errno is valid.
----*/
rename_file(tmpfname, fname)
char *tmpfname, *fname;
{
int status;
(void) unlink(fname);
if ((status = link(tmpfname, fname)) != 0)
return(status);
(void) unlink(tmpfname);
return(0);
}